package com.chenyun.cocobackend.mapper;

import com.chenyun.cocobackend.entity.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserMapper {
    @Select("select * from sys_user")
    List<User> selectAll();

    @Insert("insert into sys_user(username,password,nickname,email,phone,address,create_time)values (#{username},#{password},#{nickname},#{email},#{phone},#{address},#{createTime})")
    boolean insert(User user);

    @Update("update sys_user set username=#{username},password=#{password},nickname=#{nickname},email=#{email},phone=#{phone},address=#{address},create_time=#{createTime} where id=#{id}")
    boolean update(User user);

    @Delete("delete from sys_user where id=#{id}")
    boolean deleteById(Integer id);
}
